import axios, {
  InternalAxiosRequestConfig,
  AxiosResponse,
  AxiosError,
} from '@ohos/axios';
import { ApiResponse, VideoListData } from '../utils/api-types';
import instance from '../utils/request';

// 通用获取平台视频函数
export const getPlatformVideos = (
  platform: string,  // 平台名称参数
  page: number,
  limit: number
): Promise<AxiosResponse<ApiResponse<VideoListData>, any>> => {
  return instance.get<ApiResponse<VideoListData>>(
    `/api/v1/admin/${platform}/videos?page=${page}&limit=${limit}`
  );
};


export const getKuaishouhaoVideos = (page: number, limit: number) =>
getPlatformVideos('kuaishouhao', page, limit);

export const getdouyinVideos = (page: number, limit: number) =>
getPlatformVideos('douyin', page, limit);

export const getxiaohongshuVideos = (page: number, limit: number) =>
getPlatformVideos('xiaohongshu', page, limit);